package com.hengtiansoft.lfy.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;

/**
 * Created by Administrator on 2016/4/18.
 */
public class MyTextView extends TextView {
    private Context mContext=null;
    public MyTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mContext=context;
    }
    public MyTextView(Context context) {
        super(context);
        mContext=context;
    }

  /*  @Override
    public void createContextMenu(ContextMenu menu) {
       // super.createContextMenu(menu);
    }
@Override
    protected void onCreateContextMenu(ContextMenu menu) {
        menu=null;
       // super.onCreateContextMenu(menu);
    }*/

    @Override
    public boolean onTextContextMenuItem(int id) {
//      //  Log.i("supeng","id="+id);
       boolean b= super.onTextContextMenuItem(id);
        if(id==android.R.id.copy||id==android.R.id.cut){
            ((AlertDialog)mContext).finish();
        }
        return b;
    }
}
